import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        name: 'login',
        path: '/login',
        component: () => import('@/views/Login.vue')

    }
    , {
        name: 'home',
        path: '/',
        component: () => import('@/components/Home.vue'),
        redirect: '/purchase/in',
        children: [
            {
                name: 'welcome',
                path: '/welcome',
                component: () => import('@/views/Welcome.vue')
            }
            , {
                name: '采购入库',
                path: '/purchase/in',
                component: () => import('@/views/purchase/In.vue')
            }
            , {
                name: '领料出库',
                path: '/inside/out',
                component: () => import('@/views/inside/Out.vue')
            }
            , {
                name: '空瓶入库',
                path: '/inside/in',
                component: () => import('@/views/inside/In.vue')
            }
            , {
                name: '空瓶出库',
                path: '/purchase/out',
                component: () => import('@/views/purchase/Out.vue')
            }
            , {
                name: '退料入库',
                path: '/other/in',
                component: () => import('@/views/other/In.vue')
            }
            , {
                name: '非生产领料出库',
                path: '/other/out',
                component: () => import('@/views/other/Out.vue')
            }
            , {
                name: '设置仓库',
                path: '/settings',
                component: () => import('@/views/Settings.vue')
            }
        ]

    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router